import { S } from '../../s';
import { IPSDEMainState } from './ipsdemain-state';
import { IPSDEMainStateOPPriv } from './ipsdemain-state-oppriv';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEMainStateImpl
  extends PSModelObjectImpl
  implements IPSDEMainState
{
  get actionDenyMsg(): string {
    return this.M.actionDenyMsg;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get enterStateMode(): 'ANY' | 'SOME' {
    return this.M.enterStateMode;
  }

  get logicName(): string {
    return this.M.logicName;
  }

  get mSTag(): string {
    return this.M.mSTag;
  }

  get oPPrivDenyMsg(): string {
    return this.M.oPPrivDenyMsg;
  }

  get orderValue(): number {
    return this.M.orderValue != null ? this.M.orderValue : 99999;
  }

  protected psdemainstateopprivs: IPSDEMainStateOPPriv[];
  getPSDEMainStateOPPrivs(): IPSDEMainStateOPPriv[] | null {
    return (
      this.psdemainstateopprivs ||
      (this.psdemainstateopprivs = this.fillChildListModel(
        this.M.getPSDEMainStateOPPrivs,
        S._1f5,
      ) as IPSDEMainStateOPPriv[])
    );
  }

  findPSDEMainStateOPPriv(objKey: any): IPSDEMainStateOPPriv | null {
    return this.getPSModel5(
      S._1f5,
      this.getPSDEMainStateOPPrivs(),
      objKey,
    ) as IPSDEMainStateOPPriv;
  }

  protected prevpsdemainstates: IPSDEMainState[];
  getPrevPSDEMainStates(): IPSDEMainState[] | null {
    return (
      this.prevpsdemainstates ||
      (this.prevpsdemainstates = this.fillChildListModel(
        this.M.getPrevPSDEMainStates,
        S._208,
      ) as IPSDEMainState[])
    );
  }

  get state2Value(): string {
    return this.M.state2Value;
  }

  get state3Value(): string {
    return this.M.state3Value;
  }

  get stateValue(): string {
    return this.M.stateValue;
  }

  get viewActions():
    | 1
    | 2
    | 4
    | 8
    | 16
    | 32
    | 64
    | 1024
    | 128
    | 256
    | 512
    | 2048 {
    return this.M.viewActions;
  }

  get wFStateMode(): 0 | 1 | 2 | 3 {
    return this.M.wFStateMode;
  }

  get actionAllowMode(): boolean {
    return this.M.actionAllowMode;
  }

  get allowMode(): boolean {
    return this.M.allowMode;
  }

  get default(): boolean {
    return this.M.default;
  }

  get enableViewActions(): boolean {
    return this.M.enableViewActions;
  }

  get fieldAllowMode(): boolean {
    return this.M.fieldAllowMode;
  }

  get oPPrivAllowMode(): boolean {
    return this.M.oPPrivAllowMode;
  }
  get cls(): string {
    return 'PSDEMainStateImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._208) return true;
    return super.instanceof(cls);
  }
}
